/*
 * Copyright 2009 by Konstantin Bulenkov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.bulenkov.crawler;

import java.net.URL;
import java.util.Set;
import java.util.regex.Pattern;

/**
 * @author Konstantin Bulenkov (konstantin@bulenkov.com)
 */
public interface JobProfile {
  /**
   * Returns name of a job
   *
   * @return name of a job
   */
  String getName();

  /**
   * Return start URLs for crawler
   *
   * @return start URLs
   */
  Set<URL> getStartURLs();

  /**
   * Crawler downloads a page if and only if set of patterns is empty or
   * exists at least one pattern in the set that page's URL matches.
   *
   * @return URLs patterns for crawler or empty set in case of global crawling
   */
  Set<Pattern> getCrawlerBounds();

  /**
   * Crawler saves only URLs that match at least one pattern from the set.
   * These URLs are used by indexers.
   *
   * @return URLs patterns for indexer
   */
  Set<Pattern> getIndexerBounds();

  /**
   * Returns maximum number of threads the crawler can use for particular job
   *
   * @return maximum number of threads
   */
  int getMaxThreadsCount();
}
